home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Camelot / Camelot 105 (1991-02)(Swedish User Group of Amiga)(SE)(PD)[WB].zip / Camelot 105 (1991-02)(Swedish User Group of Amiga)(SE)(PD)[WB].adf / AmigaUUCP / include / ndir.h < prev    next >
C/C++ Source or Header  |  1991-02-14  |  1KB  |  53 lines

  1.  
  2. /*
  3.  *  ndir.h -- header file for the ``ndir'' directory routines.
  4.  *
  5.  */
  6.  
  7. #ifndef _NDIR_H
  8. #define _NDIR_H
  9.  
  10. #ifndef LIBRARIES_DOS_H
  11. #include <libraries/dos.h>
  12. #endif
  13.  
  14. #ifndef DEV_BSIZE
  15. #define DEV_BSIZE     512
  16. #endif
  17.  
  18. #define DIRBLKSIZ    DEV_BSIZE
  19. #define MAXNAMLEN    255
  20.  
  21. struct    direct {
  22.     long    d_ino;            /* inode number of entry */
  23.     short   d_reclen;            /* length of this record */
  24.     short   d_namlen;            /* length of string in d_name */
  25.     char    d_name[MAXNAMLEN + 1];  /* name must be no longer than this */
  26. };
  27.  
  28. /*
  29.  * The DIRSIZ macro gives the minimum record length which will hold
  30.  * the directory entry.  This requires the amount of space in struct direct
  31.  * without the d_name field, plus enough space for the name with a
  32.  * terminating null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
  33.  */
  34.  
  35. #ifdef DIRSIZ
  36. #undef DIRSIZ
  37. #endif /* DIRSIZ */
  38.  
  39. #define DIRSIZ(dp) \
  40.     ((sizeof(struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
  41.  
  42. /*
  43.  * Definitions for library routines operating on directories.
  44.  */
  45.  
  46. typedef struct DIR {
  47.     long lock;
  48.     struct FileInfoBlock fib;
  49. } DIR;
  50.  
  51. #endif
  52.  
  53.